FROM alpine:3.7
LABEL Maintainer="shuaqiu <qiushaohua.bp@gmail.com>"

# Let's roll
RUN apk add --no-cache git build-base perl supervisor && \
    # libfastcommon
    git clone https://github.com/happyfish100/libfastcommon.git --depth 1 && \
    cd libfastcommon && \
    ./make.sh && \
    ./make.sh install && \
    cd .. && \
    # fastdfs
    git clone https://github.com/happyfish100/fastdfs.git --depth 1 && \
    cd fastdfs && \
    ./make.sh && \
    ./make.sh install && \
    cd .. && \
    # 复制相关的配置文件供nginx访问使用
    mv /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf && \
    mv /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf && \
    mv ./fastdfs/conf/http.conf /etc/fdfs/ && \
    mv ./fastdfs/conf/mime.types /etc/fdfs/ && \
    # Cleaning up
    rm -Rf ./libfastcommon ./fastdfs
